package com.example.customconsume.component;

import com.example.customconsume.component.chain.HandlerChain;
import com.example.customconsume.entity.ConsumeDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @Description 高级规则-- 折扣处理器
 * @Author lihw
 * @Date 2024/7/10 11:36
 */
@Order(2)
@Component
@Slf4j
public class DiscountCustomPayHandler implements CustomPayHandler<ConsumeDto> {
    @Override
    public ConsumeDto handleCustomPay(ConsumeDto consumeDto, HandlerChain handlerChain) {
        log.info("判断是否有折扣");
        handlerChain.doHandler(consumeDto);
        return consumeDto;
    }
}
